import 'package:learning/bean/result_entity.dart';
import 'package:learning/generated/json/base/json_convert_content.dart';

ResultEntity $ResultEntityFromJson(Map<String, dynamic> json) {
  final ResultEntity resultEntity = ResultEntity();
  final int? status = jsonConvert.convert<int>(json['status']);
  if (status != null) {
    resultEntity.status = status;
  }
  final String? msg = jsonConvert.convert<String>(json['msg']);
  if (msg != null) {
    resultEntity.msg = msg;
  }
  final bool? success = jsonConvert.convert<bool>(json['success']);
  if (success != null) {
    resultEntity.success = success;
  }
  final dynamic data = json['data'];
  if (data != null) {
    resultEntity.data = data;
  }
  return resultEntity;
}

Map<String, dynamic> $ResultEntityToJson(ResultEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['status'] = entity.status;
  data['msg'] = entity.msg;
  data['success'] = entity.success;
  data['data'] = entity.data;
  return data;
}

extension ResultEntityExtension on ResultEntity {
  ResultEntity copyWith({
    int? status,
    String? msg,
    bool? success,
    dynamic data,
  }) {
    return ResultEntity()
      ..status = status ?? this.status
      ..msg = msg ?? this.msg
      ..success = success ?? this.success
      ..data = data ?? this.data;
  }
}